using Z = Mint<1000000007>;
const int inf = 1e9;
Combination<1000000007> comb(50);

void solve()
{
  int n, k;
  cin >> n >> k;

  int f5 = 0, f10 = 0, x;
  rep(i, 0, n - 1) {
    cin >> x;
    if (x == 50) {
      f5++;
    } else {
      f10++;
    }
  }

  vector<vector<vector<Z>>> g(f5 + 1, vector<vector<Z>>(f10 + 1, vector<Z>(2, 0)));
  vvvi f(f5 + 1, vvi(f10 + 1, vi(2, inf)));
  
  queue<tuple<int, int, int>> Q;
  Q.push({f5, f10, 0});
  f[f5][f10][0] = 0; g[f5][f10][0] = 1;

  while (!Q.empty()) {
    auto [n, m, t] = Q.front();
    Q.pop();

    for (int i = 0; i <= n; i++) {
      if (i * 50 > k) {
        break;
      }
      for (int j = 0; j <= m; j++) {
        if (i * 50 + j * 100 > k) {
          break;
        }
        if (i + j > 0) {
          int c = f[n][m][t] + 1;
          Z v = g[n][m][t] * comb.C(n, i) * comb.C(m, j);
          if (f[f5 - n + i][f10 - m + j][t ^ 1] > c) {
            f[f5 - n + i][f10 - m + j][t ^ 1] = c;
            g[f5 - n + i][f10 - m + j][t ^ 1] = v;
            Q.push({f5 - n + i, f10 - m + j, t ^ 1});
          } else if (f[f5 - n + i][f10 - m + j][t ^ 1] == c) {
            g[f5 - n + i][f10 - m + j][t ^ 1] += v;
          }
        }
      }
    }
  }

  if (f[f5][f10][1] != inf) {
    cout << f[f5][f10][1] << '\n' << g[f5][f10][1];
  } else {
    cout << -1 << '\n' << 0;
  }
}